Testing Under Strategic Manipulation: Mechanism Design for Human and AI Institutions